package com.tengju.data.domain.model.report;


import com.tengju.data.domain.model.analysis.Row;
import com.tengju.data.domain.model.user.UserIdCode;
import com.tengju.data.domain.shared.Year;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

public interface AchievementBonusRepository {

    void saveAchievementBonus(List<AchievementBonus> achievementBonusList);

    void saveAchievementBonusLog(LocalDateTime logTime, Integer month);

    List<AchievementBonus> find(LocalDate month, UserIdCode idCode);

    List<AchievementBonus> findByConfigDateKey(Integer dateKey, UserIdCode idCode);

    int getMaxVersion();

    void deleteInvalidData(Integer month, Integer version);

    List<AchievementBonusSum> sumByYear(UserIdCode idCode, LocalDate year);

    List<AchievementBonusSum> getAchievementByYear(UserIdCode idCode, Year year);

    List<Row> getAchievementByTeamRatioType(UserIdCode idCode,Integer month);

    List<AchievementBonus> findChild(LocalDate monthDate, UserIdCode idCode);

    BigDecimal getBonus(Long idCode, Integer status, Integer month);

    int countMarketBonusUser(Integer month);

    List<UserBonusResult> listMarketBonus(Integer month, AchievementBonusStatusEnum bonusStatus, List<Long> idCodes);

    void updateBonusStatus(Long idCode, Integer month, AchievementBonusStatusEnum curStatus, AchievementBonusStatusEnum targetStatus);

    List<Long> listBonusSettleUser(Integer month, Integer offset, Integer batch_query_limit);

    List<AchievementBonus> listByIdCodesAndMonth(Integer month, List<Long> idCodeList);

    List<UserBonusResult> listAllMarketBonus(Integer month, AchievementBonusStatusEnum bonusStatus, List<Long> idCodes);

}
